package com.zixun.repository;

import com.zixun.model.Bill;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * Created by Basil on 16/8/27.
 */
public interface BillRepository extends JpaRepository<Bill,Integer>,JpaSpecificationExecutor<Bill>{

    @Query("select bill from Bill bill where bill.userId = :id ")
    List<Bill> findAllByUserId(@Param("id")Integer id);


}
